import { Local } from './storage'

//存储和取出token
const TokenKey = 'Admin-Token'

export function getToken() {
	return Local.get(TokenKey)
}

export function setToken(token) {
	return Local.set(TokenKey, token)
}

export function removeToken() {
	Local.remove('username')
	Local.remove('password')
	return Local.remove(TokenKey)
}

//存储和取出存储的浏览器存储的OpenId。
// //（不用cookie,容量太少） add rico 2023-10-03
const OpenIdKey = 'OpenId'
export function getOpenId() {
	return Local.get(OpenIdKey)
}

export function setOpenId(openid) {
	return Local.set(OpenIdKey, openid)
}

export function removeOpenId() {
	return Local.remove(OpenIdKey)
}
